#include "obj_action.hh"

ObjAction::ObjAction ()
{
  for (int i = 0; i < 3; ++i)
    {
      move_ (0, 0);
      rotate_ (0, 0);
    }
}

ObjAction::~ObjAction ()
{}

void
ObjAction::add_move (const Vector3f& move)
{
  move_ += move;
}

void
ObjAction::add_rotate (const Vector3d& rotate)
{
  rotate_ += rotate;
}

void
ObjAction::normalize ()
{
  for (int i = 0; i < 3; ++i)
    {
      if (rotate_ (i) > 0)
	rotate_ (i, 10);
      else if (rotate_ (i) < 0)
	rotate_ (i, -10);

      if (move_ (i) > 0)
	move_ (i, 1);
      else if (move_ (i) < 0)
	move_ (i, -1);
    }
}
